package com.homework6;

import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

public class demo01 {
    public static void main(String[] args) throws IOException {
        InputStreamReader gbk = new InputStreamReader(new FileInputStream("D:\\a1.txt"), "gbk");
        char[] chars=new char[10];
        int read;
        while ((read=gbk.read(chars))!=-1){
            System.out.println(new String(chars,0,read));
        }
        gbk.close();
    }
}
